package com.yumeno.market_goods.service.impl;

import com.yumeno.market_goods.dao.GoodsDao;
import com.yumeno.market_goods.pojo.entity.Goods;
import com.yumeno.market_goods.service.GoodsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@Service
public class GoodsServiceImpl implements GoodsService {

    @Resource
    private GoodsDao goodsDao;

    @Override
    public Map<String, Object> add(Goods goods) {
        Map<String,Object> resMap=new HashMap<>();
        int i = goodsDao.insertSelective(goods);
        if (i==1){
            resMap.put("res",true);
            resMap.put("msg","添加成功");
        }else {
            resMap.put("res",false);
            resMap.put("msg","添加失败");
        }
        return resMap;
    }
}
